-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QOS fieldvalue reference ABNF format to string #1626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AshokDaparthi
Some other parts need to be updated as well:
- The buffer configuration is stored in APPL_DB. The warm reboot will fail if the switch is upgrading from an image before this change to one after. So db migrator needs to handle APPL_DB as well.
- Suggest adding unit test cases for db migrator.
- The version defined at the beginning of db_migrator.py needs to be updated as well.
- Existing unit test cases need to be updated accordingly, like mock_tables, and mock tables for qos, filter fdb, counter poll, SKU create tool, etc... You might want to go over all the test cases.
I believe the unit test is failing without these changes
Thanks
@stephenxs - Hi Stephan, I have query regarding "The buffer configuration is stored in APPL_DB. The warm reboot will fail if the switch is upgrading from an image before this change to one after. So db migrator needs to handle APPL_DB as well." I have not seen complete warm reboot design. Can you help me to understand, While warm/cold reboot db_migratory.py will trigger config_db update for qos right, which internally trigger swss to update APP_DB with new QOS field values right or during warmreboot swss will not process config_db updates? |
The buffer tables are consumed from APPL_DB instead of CONFIG_DB.
This is for both dynamic and traditional buffer models.
We have a similar flow which the entries in APPL_DB is prepared for warm reboot. prepare_dynamic_buffer_for_warm_reboot. It works for both buffer model. |
7572243
to
6acf650
Compare
/azpw run |
56c5dab
to
e1b6e42
Compare
02f1290
to
cfe3542
Compare
config/main.py
Outdated
@@ -3703,7 +3703,7 @@ def update_pg(ctx, interface_name, pg_map, override_profile, add = True): | |||
ctx.fail("Profile {} doesn't exist".format(override_profile)) | |||
if not 'xoff' in profile_dict.keys() and 'size' in profile_dict.keys(): | |||
ctx.fail("Profile {} doesn't exist or isn't a lossless profile".format(override_profile)) | |||
profile_full_name = "[BUFFER_PROFILE|{}]".format(override_profile) | |||
profile_full_name = "{}".format(override_profile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think profile_full_name
is no longer necessary. Just using override_profile
should be fine.
Originally, profile_full_name
was introduced because the profile reference differed from the profile name. Now they are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
scripts/db_migrator.py
Outdated
db_key = table_name + db_delimeter + key | ||
|
||
for field in fields_list: | ||
if field in value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the indent in this block as well. The indent should be 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
scripts/db_migrator.py
Outdated
log.log_info("Found ABNF format field value in table {} key {} field {} val {}".format(table_name, db_key, field, fieldVal)) | ||
value_list = fieldVal.split(",") | ||
for item in value_list: | ||
if "[" not in item or db_delimeter not in item or "]" not in item: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "[" not in item or db_delimeter not in item or "]" not in item: | |
if "[" != item[0] or db_delimeter not in item or "]" != item[-1]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ba2d86a
to
180c48d
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@AshokDaparthi please help to monitor the build progress and check the result. |
As per the discussion in yang-subgroup-meeting (8/26) with @lguohan , we have decided to merge sonic-utilities PR (#1626) 1st followed by sub-module update in sonic-buildimage. Then this sonic-swss PR (sonic-net/sonic-swss#1754) should be merged. Merge can happen in this order: |
180c48d
to
b1bd4a3
Compare
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
@stephenxs , @neethajohn - Could you please re approve. Plan is to |
Hi @AshokDaparthi
Thanks |
1# No changes, I did rebase all my pull requests to latest master |
@neethajohn - Could you please review and approve. |
@neethajohn can you please help to review and approve this. |
Depends on sonic-net/sonic-utilities#1626 Depends on sonic-net/sonic-swss#1754 QOS tables in config db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue to other qos tables. Example: Config DB: "Ethernet92|3": { "scheduler": "[SCHEDULER|scheduler.1]", "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" }, "Ethernet0|0": { "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" }, "Ethernet0": { "dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]", "pfc_enable": "3,4", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", "tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]" }, This format is not consistent with other DB schema followed in sonic. And also this reference in DB is not required, This is taken care by YANG "leafref". Removed this format from all platform files to consistent with other sonic db schema. Example: "Ethernet92|3": { "scheduler": "scheduler.1", "wred_profile": "AZURE_LOSSLESS" }, Dependent pull requests: #7752 - To modify platfrom files #7281 - Yang model sonic-net/sonic-utilities#1626 - DB migration sonic-net/sonic-swss#1754 - swss change to remove ABNF format
Depends on sonic-net/sonic-swss#1754
Qos tables in config db and app db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue other qos tables.
Example:
Config DB:
"Ethernet92|3": {
"scheduler": "[SCHEDULER|scheduler.1]",
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]"
},
"Ethernet0|0": {
"profile": "[BUFFER_PROFILE|ingress_lossy_profile]"
},
"Ethernet0": {
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]",
"pfc_enable": "3,4",
"pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]",
"tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]",
"tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]"
},
AppDB:
"BUFFER_QUEUE_TABLE:Ethernet88:3-4": {
"profile": "[BUFFER_PROFILE_TABLE:egress_lossless_profile]"
},
1#This format is not consistent with other DB schema followed in sonic.
2# Added db_migrator.py case to change from old format in config_db and appl_db to new format.
3#Modified the test case
Dependent pull requests:
sonic-net/sonic-buildimage#7752 - To modify platfrom files
sonic-net/sonic-buildimage#7281 - Yang model
sonic-net/sonic-swss#1754 - swss change to remove ABNF format